package com.luguangtao.dao;

import com.luguangtao.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface UserDao extends JpaRepository<User,Integer> {
    List<User> findByUserid(Integer userid);

    //测试query查询的分页
    @Query(value = "select * from tt_user order by birth desc",nativeQuery = true)
    public Page<User> getUserList4(Pageable pageable);

}
